{include file="public/head"}

<body>
<div id="wrapper">
    {include file="public/menu"}

    <div id="page-wrapper" class="gray-bg dashbard-1">
        {include file="public/nav"}
        <div class="row wrapper border-bottom white-bg page-heading">
            <div class="col-lg-10">
                <h2>财务信息</h2>
                <ol class="breadcrumb">
                    <li>
                        <a href="{:url('Index/index')}">主页</a>
                    </li>
                    <li>
                        <a>财务</a>
                    </li>
                    <li>
                        <strong>定存记录</strong>
                    </li>
                </ol>
            </div>
            <div class="col-lg-2">

            </div>
        </div>
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>定存记录列表</h5>
                            <div class="ibox-tools">
                                <small>共 {$Count} 条</small>
                            </div>
                        </div>

                        <div class="ibox-content">
                            <form method="get" action="{:url('Finance/FinanceList')}">
                                <div class="row">
                                    <div class="col-sm-4 m-b-xs">
                                        <div class="row">
                                            <div class="col-sm-2 m-b-xs"></div>
                                            <div class="col-sm-3 m-b-xs">奖金类型</div>
                                            <div class="col-sm-7 m-b-xs">
                                                <select class="input-sm form-control input-s-sm inline" id="cycle" name="cycle">
                                                    <option value="0" {if condition="$Data.cycle eq 1"}selected{/if}>全部</option>
                                                    <option value="1" {if condition="$Data.cycle eq 1"}selected{/if}>半年定存</option>
                                                    <option value="2" {if condition="$Data.cycle eq 2"}selected{/if}>一年定存</option>
                                                    <option value="3" {if condition="$Data.cycle eq 3"}selected{/if}>二年定存</option>
                                                    <option value="4" {if condition="$Data.cycle eq 4"}selected{/if}>三年定存</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-sm-4 m-b-xs">
                                        <div class="row">
                                            <div class="col-sm-2 m-b-xs"></div>
                                            <div class="col-sm-3 m-b-xs">会员账号</div>
                                            <div class="col-sm-7 m-b-xs">
                                                <input type="text" class="input-sm form-control input-s-sm inline" id="username" name="username" value="{$Data.username|default=''}">
                                            </div>
                                        </div>
                                    </div>


                                </div>
                                <div class="row">
                                    <div class="col-sm-4 m-b-xs">
                                        <div class="row">
                                            <div class="col-sm-2 m-b-xs"></div>
                                            <div class="col-sm-3 m-b-xs">开始时间</div>
                                            <div class="col-sm-7 m-b-xs">
                                                <input type="datetime-local" class="input-sm form-control input-s-sm inline" id="begin_time" name="begin_time" value="{$Data.begin_time|default=''}">
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-sm-4 m-b-xs">
                                        <div class="row">
                                            <div class="col-sm-2 m-b-xs"></div>
                                            <div class="col-sm-3 m-b-xs">结束时间</div>
                                            <div class="col-sm-7 m-b-xs">
                                                <input type="datetime-local" class="input-sm form-control input-s-sm inline" id="end_time" name="end_time" value="{$Data.end_time|default=''}">
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-sm-4 m-b-xs">
                                        <div class="row">
                                            <div class="col-sm-6 m-b-xs"></div>
                                            <div class="col-sm-6 m-b-xs">
                                                <button class="btn btn-sm btn-primary" type="submit" id="search"><i class="fa fa-search"></i> 搜索</button>
                                                <button class="btn btn-sm btn-success" type="submit" id="export">导出Excel</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </form>
                            <div class="table-responsive">
                                <table class="table table-hover">
                                    <thead>
                                    <tr>
                                        <th>#</th>
                                        <th>会员账号</th>
                                        <th>当前等级</th>
                                        <th>定存金额</th>
                                        <th>剩余金额</th>
                                        <th>定存时间</th>
                                        <th>定存周期</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {volist name="DepositList" id="v"}
                                    <tr>
                                        <td>{$key+1}</td>
                                        <td>{$v.user_name}</td>
                                        <td>{$v.level_name}</td>
                                        <td>{$v.num}</td>
                                        <td>{$v.surplus_num}</td>
                                        <td>{$v.add_time|date="Y-m-d H:i:s",###}</td>
                                        <td>
                                            {if condition="$v.cycle eq 1"}半年定存
                                            {elseif condition="$v.cycle eq 2"}一年定存
                                            {elseif condition="$v.cycle eq 3"}二年定存
                                            {elseif condition="$v.cycle eq 4"}三年定存
                                            {/if}
                                        </td>
                                    </tr>
                                    {/volist}
                                    </tbody>
                                </table>
                            </div>
                            <div class="row" style="text-align: center">
                                {$Page}
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
        {include file="public/foot"}

    </div>
</div>
</div>
{include file="public/footer"}
<script>
    /*条件搜索*/
    var searchurl = "{:url('Finance/DepositList')}";
    $('#search').click(function () {

        $('form').attr('action',searchurl);
    });

    /*Excel导出*/
    var exporturl = "{:url('Finance/DepositExport')}";
    $('#export').click(function () {

        $('form').attr('action',exporturl);
    });
</script>
</body>
</html>
